/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.scrumpmt.domain;

import java.util.Collection;
import java.util.Date;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author agumpg
 */
@Entity
@Table(name = "SPRINT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sprint.findAll", query = "SELECT s FROM Sprint s"),
    @NamedQuery(name = "Sprint.findById", query = "SELECT s FROM Sprint s WHERE s.id = :id"),
    @NamedQuery(name = "Sprint.findByFecini", query = "SELECT s FROM Sprint s WHERE s.fecini = :fecini"),
    @NamedQuery(name = "Sprint.findByFecfin", query = "SELECT s FROM Sprint s WHERE s.fecfin = :fecfin"),
    @NamedQuery(name = "Sprint.findByDes", query = "SELECT s FROM Sprint s WHERE s.des = :des")})
public class Sprint extends BaseEntity {
    @Column(name = "fecini", nullable=false)
    @Temporal(TemporalType.DATE)
    private Date fecini;
    @Column(name = "fecfin", nullable=false)
    @Temporal(TemporalType.DATE)
    private Date fecfin;
    @Column(name = "des", nullable=false)
    private String des;
    @JoinColumn(name = "id_proyecto_fk", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Proyecto idProyectoFk;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSprintFk")
    private Collection<Tarea> tareaCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idSprintFk")
    private Collection<Reunion> reunionCollection;

    public Sprint() {
    }

    public Date getFecini() {
        return fecini;
    }

    public void setFecini(Date fecini) {
        this.fecini = fecini;
    }

    public Date getFecfin() {
        return fecfin;
    }

    public void setFecfin(Date fecfin) {
        this.fecfin = fecfin;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    public Proyecto getIdProyectoFk() {
        return idProyectoFk;
    }

    public void setIdProyectoFk(Proyecto idProyectoFk) {
        this.idProyectoFk = idProyectoFk;
    }

    @XmlTransient
    public Collection<Tarea> getTareaCollection() {
        return tareaCollection;
    }

    public void setTareaCollection(Collection<Tarea> tareaCollection) {
        this.tareaCollection = tareaCollection;
    }

    @XmlTransient
    public Collection<Reunion> getReunionCollection() {
        return reunionCollection;
    }

    public void setReunionCollection(Collection<Reunion> reunionCollection) {
        this.reunionCollection = reunionCollection;
    }

}
